package com.elitel.frame.business.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.elitel.frame.base.service.DBServerService;
import com.elitel.frame.main.entity.BaseSqlconfig;
import com.elitel.frame.main.entity.BaseStaconfig;
import com.fasterxml.jackson.databind.deser.Deserializers.Base;

@Component
@RequestMapping(value="/business/serverSearch")
public class ServerSearchController {
	@Resource
	private  DBServerService dbServerServiceImpl;
	
	@RequestMapping(value="/selectServerColumn")
	@ResponseBody
	public List<BaseSqlconfig> selectServerColumn(HttpServletRequest request){
		String guid = request.getParameter("serviceID");
		String uuid = UUID.randomUUID().toString();
		List<BaseSqlconfig> list = dbServerServiceImpl.selectServerColumn(guid);
		List<BaseSqlconfig> list2 = new ArrayList<>();
		for(BaseSqlconfig b:list){
			if (b.getFieldcaption()!=null) {
				list2.add(b);
			}
		}
		return list2;
	}
}
